package mgt.pages

class ApiDefinitionEditPage extends geb.Page {
    static url = "/apiDefinition/edit"

    static content = {
        descriptionField(wait: true) { $("#description") }
        backendTiemoutField(wait: true) { $("#backendTimeout") }

        updateButton(to: ApiDefinitionShowPage) { $(".save") }
    }

    ApiDefinitionShowPage editApiDefinition(Long backendTimeout, String description) {
        backendTiemoutField.value(backendTimeout)
        descriptionField.value(description)

        updateButton.click()

        return browser.page
    }
}